package cn.t.web.ent;

import cn.t.core.mode.PageInfoDTO;
import cn.t.core.mode.PageQueryDTO;
import cn.t.facade.order.WorkOrderFacade;
import cn.t.request.WorkOrderReq;
import cn.t.vo.ent.EntWorkOrderDetailVO;
import cn.t.vo.order.WorkOrderVO;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * 企业站-工单管理
 */
@Slf4j
@RestController
@RequestMapping("/ent/workOrder")
@AllArgsConstructor
public class EntWorkOrderController {

    private final WorkOrderFacade workOrderFacade;

    /**
     * 工单分页列表
     */
    @PostMapping("/page")
    public PageInfoDTO<WorkOrderVO> page(@RequestBody PageQueryDTO<WorkOrderReq> req) {
        return this.workOrderFacade.page(req);
    }

    /**
     * 工单详情
     */
    @GetMapping("/detail/{id}")
    public EntWorkOrderDetailVO detail(@PathVariable Long id) {
        return this.workOrderFacade.entWorkOrderDetail(id);
    }
}

